"use strict";
var rvc = require("../..");
var app = new rvc.App();
var static_res = rvc.static_res;
var post = rvc.post;
var qs = require("querystring");
app.use(static_res(__dirname + "/public"));
app.use(post);

app.post("/post", function (req, res) {
    res.write("post success!\n");
    res.write("-------------\n");
    res.write("title: \n");
    res.write(req.body.title + "\n");
    res.write("content: \n");
    res.write(req.body.content);
    res.end();
});

app.post("/data", function (req, res) {

    var fs = require("fs");
    console.log(__dirname + "/public/file.ico");
    fs.writeFile(__dirname + "/public/file.ico", req.files.img, function () {
        res.write("ok");
        res.end();
    });

});
app.listen(3000);